﻿using Application.Models;
using Application.Roles.Interfaces.Repositories;
using MediatR;

namespace Application.Roles.Queries.GetById
{
    public class GetByIdsQueryHandle(IRoleReadRepository roleRead) : IRequestHandler<GetRoleByIdQuery, IReadOnlyList<RoleDto>?>
    {
        public async Task<IReadOnlyList<RoleDto>?> Handle(GetRoleByIdQuery request, CancellationToken cancellationToken)
        {
            return await roleRead.GetRoleByIds(request.UserIds);
        }
    }
}
